Skip to content

Fix Python docs: correct Py.Decorator to Py.Decorate#227

Merged
dbrattli merged 3 commits intodevfrom
fix-python-docs
Mar 1, 2026
Merged

Fix Python docs: correct Py.Decorator to Py.Decorate#227
dbrattli merged 3 commits intodevfrom
fix-python-docs

Conversation

@dbrattli
Copy link
Collaborator

@dbrattli dbrattli commented Mar 1, 2026

Summary

  • Rename Py.Decorator to Py.Decorate to match the actual API name
  • Replace record type example with class example (records already compile to @dataclass automatically, and Py.Decorate cannot be used on records)
  • Remove function decorator example (Fable doesn't support attributes on functions, only on types)
  • Add single-argument form example for local decorators
  • Move Class Attributes section before Python Decorators since the decorator example references Py.ClassAttributes

Test plan

  • Verify the docs site renders correctly with the updated section ordering
  • Confirm the F# code examples are accurate

🤖 Generated with Claude Code

dbrattli and others added 3 commits March 1, 2026 09:09
- Rename Py.Decorator to Py.Decorate (the actual API name)
- Replace record example with class example (records already compile to
  @DataClass automatically, and Py.Decorate cannot be used on records)
- Remove function decorator example (Fable doesn't support attributes on
  functions, only on types)
- Add single-argument form example for local decorators
- Move Class Attributes section before Python Decorators since the
  decorator example references Py.ClassAttributes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Explain the different style and init parameters for Py.ClassAttributes,
and document Py.DataClass as a shorthand for frameworks like Pydantic.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Document Py.DecorateTemplate for creating reusable custom decorator
attributes, with a web framework route decorator as an example.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dbrattli dbrattli merged commit f13e7ef into dev Mar 1, 2026
2 checks passed
@dbrattli dbrattli deleted the fix-python-docs branch March 1, 2026 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant